package com.yzy.fly.boot.tableSharding;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yzy.fly.kernel.model.FlyBasicModel;
import com.yzy.fly.util.DateUtil;
import lombok.Data;
import lombok.experimental.FieldNameConstants;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@FieldNameConstants
//@FlyMapper(ds = "fly")
@Data
@TableName(value = "fly_table_shard_config")
public class FlyTableShardConfig extends FlyBasicModel<Long, FlyTableShardConfig> {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String tableSchema;
    private String tableName;

    private String type; //date

    @TableField(value = "`value`")
    private String value; //


    @DateTimeFormat(pattern = DateUtil.DateFormatPattern.yyyy_MM_dd_HH_mm_ss)
    @JsonFormat(pattern = DateUtil.DateFormatPattern.yyyy_MM_dd_HH_mm_ss)
    @JSONField(format = DateUtil.DateFormatPattern.yyyy_MM_dd_HH_mm_ss)
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

}
